"""
@作者 = "陈诗"
@email = 3168157154@qq.com
@creative_time = 2025/10/27 19:29
"""


class House:
    def __init__(self, house_type, area):  # 房型, 总面积
        self.free_area = area
        self.area = area
        self.house_type = house_type
        self.item_list = []

    def __str__(self):
        return f"户型:{self.house_type} 总面积{self.area} 剩余:{self.free_area} 家具:{self.item_list}"

    def add_item(self, item):
        print(f"添加家具:{item}")
        self.free_area -= item.area  # 减去商品面积
        if item.area > self.free_area:
            return f"{item}面积过大,无法添加"
        else:
            self.item_list.append(item.name)
            return
